{% extends "base.html" %}
{% load tags %}
{% block title %}Firmos projektų ataskaita{% endblock %}
{% block pickDate %}{% include "monthPicker.html" %}{% endblock %}
{% block content %}
<h1 class="headerText">Firmos vykdyti projektai</h1>
<table class="sortable reportTable" >
  <thead>
    <tr>
      <th sort_index="0" rowspan="2">Projekto kodas</th>
      <th sort_index="1" rowspan="2">Projekto pavadinimas</th>
      <th sort_index="2" rowspan="2">Projekto vadovas</th>
      <th sort_index="3" rowspan="2">Vadovo skyrius</th>
      <th sort_index="4" rowspan="2">Pradžia</th>
      <th sort_index="5" rowspan="2">Pabaiga</th>
      <th colspan="3">Išdirbta (val./laik.)</th>
      <th colspan="3">Ataskaita</th>
    </tr>
    <tr>
      <th sort_index="6">Viso</th>
      <th sort_index="7">Šitas skyrius</th>
      <th sort_index="8">Kiti skyriai</th>
      <th class="sorttable_nosort">Projekto</th>
      <th class="sorttable_nosort">Intensyvumo</th>
      <th class="sorttable_nosort">Biudžeto</th>   
    </tr>
  </thead>
  <tbody>
    {% for p in project %}
    <tr class="{{ forloop.counter|oddOrEven }}">
      <td>{% if p.manager %}<a href="/project/manager/{{ p.projectId }}">{{ p.projectId }}</a>{% else %}{{ p.projectId }}{% endif %}</td>
      <td class="left">{% if p.manager %}<a href="/project/manager/{{ p.projectId }}">{{ p.project }}</a>{% else %}{{ p.project }}{% endif %}</td> 
      <td>{% if p.manager %}<a href="/project/list/{{ p.manager }}">{{ p.manager }}</a>{% else %}{{ p.manager }}{% endif %}</td>   
      <td>{% if p.manager %}<a href="/department/manager/{{ p.departmentId }}">{% firstof p.department p.departmentId %}</a>{% else %}{% firstof p.department p.departmentId %}{% endif %}</td>
      <td nowrap="nowrap">{{ p.started|date:"Y-m" }}</td>
      <td nowrap="nowrap">{{ p.finished|date:"Y-m" }}</td>
      <td>{{ p.total }}</td>
      <td>{{ p.local }}</td>
      <td>{{ p.foreign }}</td>
      <td>{% if p.manager %}<a href="/project/manager/{{ p.projectId }}"><img src="/images/report.png" /></a>{% endif %}</td>
      <td>{% if p.manager %}<a href="/project/intensity/{{ p.projectId }}/{{ startDate }}/{{ endDate }}"><img src="/images/bar_chart.png" /></a>{% endif %}</td>
      <td>{% if p.manager %}<a href="/project/budget/{{ p.projectId }}/{{ startDate }}/{{ endDate }}"><img src="/images/budget.png" /></a>{% endif %}</td>
    </tr> 
    {% endfor %}
  </tbody>
</table>
{% endblock %}
